package com.gem.myfirstandroid;



import android.app.Activity;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class LoginActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_login);
	}

	
	public void login(View v) {
		EditText edtEmpId=(EditText)findViewById(R.id.edtEmpId); 
		String   s= edtEmpId.getText().toString(); //1
		TextView  tvResult=(TextView) findViewById(R.id.tvResult);  
		Integer result=Integer.parseInt(s) + Integer.parseInt(s);
		tvResult.setText(result.toString());  //1+1
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
}
